This is a sample style sheet produced by Microsoft Word on the Macintosh. It is designed to demonstrate the various styles that I use. Of course, you can define your own style sheets and use your own style names - but this should be a useful example to get you started. The latest version of this document and other information about RTFtoHTML is kept at http://www.sunpack.com/RTF. You may contact the author: Chris Hector at chris@sunpack.com
This is pre-formatted text tab stops are supposed to be about 8 chars wide need a total width of 80 columns and a fixed width font like Courier 0 1 2 3 4 5 6 7 8 1234567890123456789012345678901234567890123456789023456789012345678901234567890 x x x x x x x x x x x x x x x x x x
Here is a block quote. Just how long do you thing this should be? I don't know - just keep typing until eventually you fill up several lines.
Bold
Italic
Underline
Hidden Text - the text between the parenthesis will be discarded by the filter ()
Monospaced fonts like courier will go to <tt>
This is a footnote[1] ..
This is a Picture
which will be either inlined or linked to by an HREF.
This is a picture
that
will be used as the "HOT" part of a hypertext link.
This is a manually generated hypertext link to an external document.
This is a hypertext link to a target somewhere else within the same document. This was created with a copy/paste-link.
This is another hypertext link to a target somewhere else within the same document. This was created manually and the target name must be as well.
This is a table
|
This
table has four columns and each column will be translated into a <pre>block that roughly approximates this layout
|
right
justified
|
centered
text
|
This
is the second row of the same table.
|
Hows
it look?
|
Good?
|
Bad?
|
This is Literal HTMLHTML as well - but uses the HTMLparagraph style, and is therefore more readable.
In order to create the illusion of nesting within an RTF document, we need to create a separate style for each level of indentation. I chose 6 as the maximum level of nesting that I care about, but rtftohtml can support as many as you want. This yeilds "ol", "ol 1", "ol 2", ... ,"ol 5". Now, in addition we have another issue with lists. The HTML bullet and numbered lists will prepend a bullet or number to your text. If you already have a bullet or number, you have three options:
Both of these options exist with the rtftohtml filter, and I have default styles for each. In order that the filter can decide where a bullet or number ends, we need a separator. The filter expects a tab character to be used. It is REALLY important that if you are using styles that remove you markers that a tab be present (or you will lose the whole list element.) You also MUST have a tab character for styles (like the <dl>) that have two parts .
Another technique for lists (particularly glossaries) to be entered with the TERM on one line, and an indented definition on the following line. These are discussed below.
Here are the sample TAB separated lists:
In some cases, you want lists to span lines. An example of this is glossaries, where the term appears on one line and the definition on another. In this case, the TERM will be defined with one style, and the DEFinition with another.
Here are some samples:
This is the target of a hypertext link. This target was created by copying the text and pasting a link to it.
This is another target of a hypertext link.. This was created by formatting some text as hidden/outline.
[1] This footnote was automatically numbered. You can use your own symbols as well.